/*
* 取号
* */

import React, { Component } from 'react';
import { Input, Form, Select, Modal, Button, Divider, Icon, message, Radio } from 'antd';
import { Util } from 'tools/index';
import ConfirmRegistrModal from './ConfirmRegistrModal';
import { $http } from 'containers/config/https';
import '../style/index.less';
import moment from 'moment';

const Option = Select.Option;
const InputGroup = Input.Group;
const FormItem = Form.Item;
const RadioGroup = Radio.Group;

class ShowGetNumModal extends Component {

    constructor(props) {
        super(props);
        this.state = {
            payWayId: '',
            payWayMoney: '0',
            realPayMoney: '',
            radioValue: '1',
            showType: true,
            otherPayMoney: 0,
            cashPayMoney: 0
        }
        this.payWayFocus = React.createRef()
        this.realMoneyFocus = React.createRef()
        this.comFirmFocus = React.createRef()
    }

    componentWillReceiveProps(nextProp) {
        if (nextProp.isShow === true) {

            var newPayWay = this.props.newPayWay;
            if (!Util.isEmpty(this.props.newPayWay)) {
                this.setState({
                    payWayId: this.props.newPayWay[0].paywID,
                    selectCode: this.props.newPayWay[0].paywCode,
                    otherPayWayId: this.props.newPayWay[1] ? this.props.newPayWay[1].paywID : '',
                    // otherPayCode: this.props.newPayWay[1].paywCode,
                })
            }

        } else if (this.props.isShow === false) {
            this.cleanInput();
        }
    }

    //组件挂载完后，给对应的element焦点
    componentDidUpdate() {
        this.realMoneyFocus.current && this.realMoneyFocus.current.focus()
    }

    closeModal() {
        this.cleanInput();
        let { onHide } = this.props;
        onHide && onHide();
    }

    //清空输入框
    cleanInput() {
        this.props.form.resetFields();
        this.setState({
            hospitalId: '',
            realPayMoney: '',
            payWayMoney: 0,
            payWayId: undefined,
            cashPayMoney: 0,
            otherPayCode: '',
            otherPayMoney: 0,
            radioValue: '1'
        })
    }

    //提交
    onSubmit() {
        var payWayCount = 0;//其他支付方式金额
        var realPayCount = 0;//现金支付金额
        let { onSubmitRegastr } = this.props;
        var registrSumData = this.props.registrSumData;
        var { payWayMoney, realPayMoney } = this.state;
        if (this.state.selectCode == !'ACC' && this.state.otherPayCode !== 'ACC') {//不使用院内账户
            //先计算金额
            var price = parseFloat(registrSumData.price) - parseFloat(registrSumData.discount) - parseFloat(registrSumData.insuSum) -
                parseFloat(registrSumData.insuBalance)
            if (parseInt(realPayMoney) >= parseFloat(price)) {
                realPayCount = price;
                payWayCount = 0;
            } else {
                realPayCount = parseInt(realPayMoney);
                payWayCount = parseFloat(registrSumData.price) - parseFloat(registrSumData.discount) - parseFloat(registrSumData.insuSum) -
                    parseFloat(registrSumData.insuBalance) - parseInt(realPayMoney);
            }
        } else {
            //先计算院内账户的总额
            var payCount = parseFloat(registrSumData.discount) + parseFloat(registrSumData.insuSum) +
                parseFloat(registrSumData.insuBalance) + parseFloat(registrSumData.accountFee)
            var realAccount = parseFloat(registrSumData.price) - parseFloat(registrSumData.discount) - parseFloat(registrSumData.insuSum) -
                parseFloat(registrSumData.insuBalance) - parseFloat(registrSumData.accountFee);
            if (payCount >= parseFloat(registrSumData.price)) {
                realPayCount = 0
                payWayCount = 0
            } else {
                if (parseInt(realPayMoney) >= parseFloat(realAccount)) {
                    realPayCount = realAccount
                    payWayCount = 0
                } else {
                    realPayCount = parseInt(realPayMoney);
                    payWayCount = parseFloat(registrSumData.price) - parseFloat(registrSumData.discount) - parseFloat(registrSumData.insuSum) -
                        parseFloat(registrSumData.insuBalance) - parseFloat(registrSumData.accountFee) - parseInt(realPayMoney);
                }
            }
        }
        //先计算应收总金额
        var hospMoney = 0
        hospMoney = (this.state.selectCode !== 'ACC' && (this.state.otherPayCode !== 'ACC')) ?
            (this.props.registrSumData ? ((parseFloat(this.props.registrSumData.price) -
                parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                0)).toFixed(2) : 0)
            : (this.props.registrSumData ? (parseFloat(this.props.registrSumData.accountFee) -
                ((parseFloat(this.props.registrSumData.price) -
                    parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                    0)) > 0 ? 0 : Math.abs(parseFloat(this.props.registrSumData.accountFee) -
                        ((parseFloat(this.props.registrSumData.price) -
                            parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                            0)))).toFixed(2) : 0)

        //院内账户余额不足校验
        if (this.state.radioValue == '1' && this.state.selectCode == 'ACC' &&
            !Util.isEmpty(this.props.registrSumData) &&
            parseFloat(this.props.registrSumData.accountBalance) < parseFloat(hospMoney)) {
            message.error('院内账户余额不足')
            return
        }

        if (this.state.realPayMoney && parseFloat(this.state.realPayMoney) < parseFloat(hospMoney)) {
            message.error('实收现金不能小于应收金额')
            return
        }

        if (this.state.radioValue == '2' && !Util.isEmpty(this.props.registrSumData)) {
            if (this.state.selectCode == 'ACC' && this.state.cashPayMoney > parseFloat(this.props.registrSumData.accountBalance)) {
                message.error('院内账户余额不足')
                return
            }
            if (this.state.otherPayCode == 'ACC' && this.state.otherPayMoney > parseFloat(this.props.registrSumData.accountBalance)) {
                message.error('院内账户余额不足')
                return
            }
        }
        var {onSubmitGetNum} = this.props;
        onSubmitGetNum && onSubmitGetNum(this.props.registrSumData, this.state.payWayId,
            payWayCount, realPayCount, this.state.hospId, this.state.checkAccount);
    }

    commonInputChange(name, e) {
        var value = e.target.value;
        var reg = /(^[1-9][0-9]*$)|(^[1-9][0-9]*\.\d{0,2}$)|^0(?!\d)\.?\d{0,2}$|^[1-9]?$/;
        if (!reg.test(value)) {
            message.error('只允许输入正整数或者两位小数！')
            return
        }

        var otherPayMoney, cashPayMoney, realPayMoney;

        //先计算应收总金额
        var hospMoney = 0
        hospMoney = (this.state.selectCode !== 'ACC' && (this.state.otherPayCode !== 'ACC')) ?
            (this.props.registrSumData ? ((parseFloat(this.props.registrSumData.price) -
                parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                0)).toFixed(2) : 0)
            : (this.props.registrSumData ? (parseFloat(this.props.registrSumData.accountFee) -
                ((parseFloat(this.props.registrSumData.price) -
                    parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                    0)) > 0 ? 0 : Math.abs(parseFloat(this.props.registrSumData.accountFee) -
                        ((parseFloat(this.props.registrSumData.price) -
                            parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                            0)))).toFixed(2) : 0)

        if (name == 'cashPayMoney') {
            if (parseFloat(value) > hospMoney) {
                message.error('支付金额不能大于应收金额！')
                return
            }
            otherPayMoney = (hospMoney - parseFloat(value || 0)).toFixed(2)
            cashPayMoney = value
            this.setState({ cashPayMoney: cashPayMoney, otherPayMoney: otherPayMoney })

        } else if (name == 'otherPayMoney') {
            if (parseFloat(value) > hospMoney) {
                message.error('支付金额不能大于应收金额！')
                return
            }
            cashPayMoney = (hospMoney - parseFloat(value || 0)).toFixed(2)
            otherPayMoney = value
            this.setState({ otherPayMoney: otherPayMoney, cashPayMoney: cashPayMoney })

        } else if (name == 'realPayMoney') {
            realPayMoney = value
            this.setState({ realPayMoney: realPayMoney })
        }
    }

    handleSelectChange(name, e, code) {
        this.setState({
            [name]: e,
            selectCode: code ? code.props.code : '',
            cashPayMoney: 0
        })
    }

    handleOtherSelectChange(name, e, code) {
        this.setState({
            [name]: e,
            otherPayCode: code ? code.props.code : '',
            otherPayMoney: 0
        })
    }

    changeRadio(e) {

        //先计算应收总金额
        var hospMoney = 0
        hospMoney = (this.state.selectCode !== 'ACC' && (this.state.otherPayCode !== 'ACC')) ?
            (this.props.registrSumData ? ((parseFloat(this.props.registrSumData.price) -
                parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                0)).toFixed(2) : 0)
            : (this.props.registrSumData ? (parseFloat(this.props.registrSumData.accountFee) -
                ((parseFloat(this.props.registrSumData.price) -
                    parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                    0)) > 0 ? 0 : Math.abs(parseFloat(this.props.registrSumData.accountFee) -
                        ((parseFloat(this.props.registrSumData.price) -
                            parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                            0)))).toFixed(2) : 0)
        if (e.target.value == '2') {
            this.setState({
                radioValue: e.target.value,
                cashPayMoney: 0,
                otherPayCode: this.props.newPayWay[1] ? this.props.newPayWay[1].paywCode : '',
            }, () => {
                this.payWayFocus.current.focus()
            })
        } else {
            this.setState({
                radioValue: e.target.value,
                cashPayMoney: hospMoney,
                otherPayCode: ''
            })
        }
    }

    changeShowType() {
        if (this.state.showType === true) {
            this.setState({
                showType: false
            })
        } else {
            this.setState({
                showType: true
            })
        }
    }

    keyDownComfirm(e) {
        if (e.keyCode == '13') {
            this.comFirmFocus.current.buttonNode.focus()
        }
    }

    onkeySubmit(e) {
        if (e.keyCode == '13') {
            this.onSubmit()
        }
    }

    onSubmitLeftElement(e) {
        this.onSubmit()
    }

    changeFocus(e) {
        if (e.keyCode == '13') {
            if (this.state.selectCode == 'CASH' || this.state.otherPayCode == 'CASH') {
                this.realMoneyFocus.current.focus()
            } else {
                this.comFirmFocus.current.buttonNode.focus()
            }
        }
    }


    render() {
        var payWayOption = []
        this.props.newPayWay && this.props.newPayWay.map((item, index) => {
            payWayOption.push(<Option key={index}
                disabled={(this.state.otherPayWayId == item.paywID && this.state.radioValue == '2') ? true : false} value={item.paywID} code={item.paywCode}>{item.paywDesc}</Option>)
        })
        var payWayOtherOption = []
        this.props.newPayWay && this.props.newPayWay.map((item, index) => {
            payWayOtherOption.push(<Option disabled={this.state.payWayId == item.paywID ? true : false} key={index} value={item.paywID} code={item.paywCode}>{item.paywDesc}</Option>)
        })

        var hospMoney = 0
        hospMoney = (this.state.selectCode !== 'ACC' && (this.state.otherPayCode !== 'ACC')) ?
          (this.props.registrSumData ? ((parseFloat(this.props.registrSumData.price) -
            parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
            0)).toFixed(2) : 0)
          : (this.props.registrSumData ? (parseFloat(this.props.registrSumData.accountFee) -
            ((parseFloat(this.props.registrSumData.price) -
              parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
              0)) > 0 ? 0 : Math.abs(parseFloat(this.props.registrSumData.accountFee) -
                ((parseFloat(this.props.registrSumData.price) -
                  parseFloat(this.props.registrSumData.discount) - parseFloat(this.props.registrSumData.insuSum) -
                  0)))).toFixed(2) : 0)

        return <div className='getNum-modal'>
            <Modal className='new-registr-modal'
                title={'取号'}
                maskClosable={false}
                autoFocusButton='ok'
                visible={this.props.isShow}
                onCancel={this.closeModal.bind(this)}
                // onOk={this.onSubmit.bind(this)}
                footer={<div><Button onClick={this.closeModal.bind(this)}>取消</Button>
                <Button className='time-save-button' ref={this.comFirmFocus}
                  // onKeyDown={this.onkeySubmit.bind(this)}
                  onClick={this.onSubmitLeftElement.bind(this)}>确定</Button></div>}>
                <div>
                    <div>
                        {this.props.registrSumData && (parseFloat(this.props.registrSumData.discount) > 0 ||
                            parseFloat(this.props.registrSumData.insuBalance) > 0 ||
                            parseFloat(this.props.registrSumData.insuSum) > 0) ?
                            <div style={{ maxHeight: 120, minHeight: 40 }}>
                                <div>
                                    {this.props.registrSumData && parseFloat(this.props.registrSumData.discount) > 0 ?
                                        <span style={{ float: 'left', marginLeft: 10, lineHeight: '30px', marginLeft: 27 }}><span>减免金额</span>
                                            {/* <span style={{ color: '#FA8C16' }}>{Util.isEmpty(this.props.registrSumData) ? undefined :
                        this.props.registrSumData.discount}</span> */}
                                            <Input className='common-point' style={{ width: 160, marginLeft: 5, textAlign: 'left' }} value={Util.isEmpty(this.props.registrSumData) ? undefined :
                                                this.props.registrSumData.discount} disabled={true} addonBefore='¥' />
                                        </span>
                                        : null}
                                    {this.props.registrSumData && (parseFloat(this.props.registrSumData.discount) > 0 ||
                                        parseFloat(this.props.registrSumData.insuBalance) > 0 ||
                                        parseFloat(this.props.registrSumData.insuSum) > 0) ?
                                        <span style={{ float: 'right', marginRight: 40, lineHeight: '30px' }}><span>应付金额</span>
                                            {/* <span style={{ color: '#FA8C16' }}>{hospMoney}</span> */}
                                            <Input style={{ width: 160, marginLeft: 5, textAlign: 'left' }} className='common-point'
                                                value={hospMoney} disabled={true} addonBefore='¥' />
                                        </span>
                                        : null}
                                </div>

                                <div >
                                    {this.props.registrSumData && parseFloat(this.props.registrSumData.insuBalance) > 0 ?
                                        <span style={{ float: 'left', marginLeft: 10, lineHeight: '35px', marginLeft: 27 }}><span>医保金额</span>
                                            <span style={{ color: '#FA8C16' }}>{Util.isEmpty(this.props.registrSumData) ? undefined :
                                                this.props.registrSumData.insuBalance}</span>
                                            <Input style={{ width: 160, marginLeft: 5, textAlign: 'left', marginTop: 5 }} className='common-point'
                                                value={Util.isEmpty(this.props.registrSumData) ? undefined :
                                                    this.props.registrSumData.insuBalance} disabled={true} addonBefore='¥' />
                                        </span>
                                        : null}

                                    {this.props.registrSumData && parseFloat(this.props.registrSumData.insuBalance) > 0 ?
                                        <span style={{ float: 'right', marginRight: 40, lineHeight: '35px' }}><span>医保账户扣款</span>
                                            <span style={{ color: '#FA8C16' }}>{Util.isEmpty(this.props.registrSumData) ?
                                                undefined : this.props.registrSumData.insuBalance}</span>
                                            <Input style={{ width: 160, marginLeft: 5, textAlign: 'left', marginTop: 5 }} className='common-point'
                                                value={Util.isEmpty(this.props.registrSumData) ? undefined :
                                                    this.props.registrSumData.insuBalance} disabled={true} addonBefore='¥' />
                                        </span>
                                        : null}
                                </div>
                                <div>
                                    {this.props.registrSumData && parseFloat(this.props.registrSumData.insuSum) > 0 ?
                                        <span style={{ float: 'left', marginLeft: 10, lineHeight: '35px', marginLeft: 27 }}><span>医保统筹</span>
                                            <span style={{ color: '#FA8C16' }}>{Util.isEmpty(this.props.registrSumData) ? undefined :
                                                this.props.registrSumData.insuSum}</span>
                                            <Input style={{ width: 160, marginLeft: 5, textAlign: 'left', marginTop: 5 }} className='common-point'
                                                value={Util.isEmpty(this.props.registrSumData) ? undefined :
                                                    this.props.registrSumData.insuSum} disabled={true} addonBefore='¥' />
                                        </span>
                                        : null}
                                    {this.props.registrSumData && parseFloat(this.props.registrSumData.insuSum) > 0 ?
                                        <span style={{ float: 'right', marginRight: 40, lineHeight: '35px' }}><span>医保基金</span>
                                            {/* <span style={{ color: '#FA8C16' }}>0</span> */}
                                            <Input style={{ width: 160, marginLeft: 5, textAlign: 'left', marginTop: 5 }} className='common-point'
                                                value={Util.isEmpty(this.props.registrSumData) ? undefined :
                                                    this.props.registrSumData.insuSum} disabled={true} addonBefore='¥' />
                                        </span>
                                        : null}
                                </div>
                                {/* <Divider dashed={false}>应收</Divider> */}
                            </div>
                            : null}
                        <div><Divider dashed={false}>应收</Divider></div>
                        {/**应收金额 */}
                        <div style={{ textAlign: 'center' }}>
                            {/**实收金额-统筹金额-减免-院内金额 */}
                            <div><span style={{ fontSize: '20px' }}>¥</span>
                                <span style={{ color: '#FA541C', fontSize: '32px', marginLeft: 10 }}>{hospMoney}</span></div>
                        </div>

                        {/**支付方式 */}
                        <div style={{ height: 40 }}>
                            <div>
                                <span style={{ float: 'left', marginLeft: 27 }}>
                                    支付方式<Select placeholder='请选择支付方式' style={{ width: 160, marginLeft: 5 }} getPopupContainer={triggerNode => triggerNode.parentNode}
                                        value={this.state.payWayId} showSearch
                                        filterOption={(input, option) =>
                                            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                            || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                        }
                                        onChange={this.handleSelectChange.bind(this, 'payWayId')}>
                                        {payWayOption}</Select>
                                    {this.state.selectCode == 'ACC' ? (!Util.isEmpty(this.props.registrSumData) && this.props.registrSumData.accountBalanceCode == 'N' ?
                                        <Icon className='registr-right-solice' /> :
                                        (!Util.isEmpty(this.props.registrSumData) && this.props.registrSumData.accountBalanceCode == 'F' ? <Icon className='registr-display-solice' /> : '')) : null}
                                    {/* {!Util.isEmpty(this.props.registrSumData) && parseFloat(this.props.registrSumData.insuBalance) >= parseFloat(hospMoney) ?
                  <Icon className='registr-right-solice'/> : <span style={{ color: 'red' }}>账户余额不足</span>} */}
                                </span>
                                <span style={{ float: 'right', marginRight: 40, lineHeight: '35px' }}>
                                    支付金额<Input style={{ width: 160, marginLeft: 5 }} addonBefore='¥' className='common-point-style'
                                        ref={this.payWayFocus}
                                        onKeyDown={this.changeFocus.bind(this)}
                                        value={(this.state.cashPayMoney) ? this.state.cashPayMoney :
                                            (this.state.selectCode == 'ACC' && this.props.registrSumData &&
                                                this.props.registrSumData.accountBalance > hospMoney ? hospMoney :
                                                (this.state.selectCode == 'ACC' && this.props.registrSumData && this.props.registrSumData.accountBalance <= hospMoney ?
                                                    this.props.registrSumData && this.props.registrSumData.accountBalance :
                                                    (this.state.radioValue == '2' && this.state.selectCode !== 'ACC' ? '' : hospMoney))
                                            )}
                                        disabled={this.state.radioValue == '1' ? true : false}
                                        onChange={this.commonInputChange.bind(this, 'cashPayMoney')} />
                                </span>
                            </div>
                        </div>

                        {this.state.selectCode == 'ACC' || (this.state.radioValue == '2' && this.state.otherPayCode == 'ACC') ? <div>
                            <span style={{ marginLeft: '12%', fontSize: '13px' }}><Icon className='doctor-table-title-splice' />
                                注：院内账户余额(元)： &nbsp;&nbsp;&nbsp;<span style={{ color: '#FA8C16' }}>{Util.isEmpty(this.props.registrSumData) ? undefined :
                                    this.props.registrSumData.accountBalance}</span>
                                {!Util.isEmpty(this.props.registrSumData) && parseFloat(this.props.registrSumData.accountBalance) >= parseFloat(hospMoney) ?
                                    '' : <span style={{ color: 'red', marginLeft: 10, fontWeight: 'blod' }}>余额不足</span>}
                            </span>
                        </div> : null}

                        <div>
                            {this.state.radioValue == '2' ? <div style={{ marginTop: 10 }}>
                                <span style={{ float: 'left' }}>
                                    其他支付方式<Select placeholder='请选择支付方式' style={{ width: 160, marginLeft: 5 }} getPopupContainer={triggerNode => triggerNode.parentNode}
                                        value={this.state.otherPayWayId}
                                        onChange={this.handleOtherSelectChange.bind(this, 'otherPayWayId')}>
                                        {payWayOtherOption}</Select>
                                    {this.state.otherPayCode == 'ACC' ? (!Util.isEmpty(this.props.registrSumData) && this.props.registrSumData.accountBalanceCode == 'N' ?
                                        <Icon className='registr-right-solice' /> :
                                        (!Util.isEmpty(this.props.registrSumData) && this.props.registrSumData.accountBalanceCode == 'F' ? <Icon className='registr-display-solice' /> : '')) : null}
                                </span>
                                <span style={{ float: 'right', marginRight: 40, lineHeight: '35px' }}>
                                    支付金额<Input className='common-point-otherPayWay'
                                        onChange={this.commonInputChange.bind(this, 'otherPayMoney')}
                                        style={{ width: 160, marginLeft: 5 }} value={(this.state.otherPayMoney) ? this.state.otherPayMoney :
                                            (this.state.otherPayCode == 'ACC' ? (this.props.registrSumData &&
                                                this.props.registrSumData.accountBalance > hospMoney ? hospMoney :
                                                ((this.props.registrSumData && this.props.registrSumData.accountBalance) ?
                                                    (this.props.registrSumData && this.props.registrSumData.accountBalance) :
                                                    (this.state.cashPayMoney && this.state.cashPayMoney.length == 0 ? '' : hospMoney))) : this.state.otherPayMoney)}
                                        addonBefore='¥' />
                                </span>
                            </div>
                                : null}
                        </div>

                        {this.state.selectCode == 'CASH' || this.state.otherPayCode == 'CASH' ? <div><Divider dashed={false}>实收现金</Divider></div> : null}

                        {this.state.selectCode == 'CASH' || this.state.otherPayCode == 'CASH' ? <div style={{ height: 40, lineHeight: '35px' }}>
                            <span style={{ marginLeft: 27, float: 'left' }}>
                                <span style={{ marginTop: 3 }}>实收现金</span><Input style={{ width: 160, marginLeft: 5 }}
                                    ref={this.realMoneyFocus} autoFocus
                                    onKeyDown={this.keyDownComfirm.bind(this)}
                                    addonBefore='¥' value={this.state.realPayMoney} placeholder='默认为应收金额'
                                    onChange={this.commonInputChange.bind(this, 'realPayMoney')} />
                            </span>
                            <span style={{ float: 'right', marginRight: 40 }}>
                                找零<Input className='common-point-otherPayWay'
                                    style={{ width: 160, marginLeft: 5 }} addonBefore='¥' disabled={true}
                                    value={(parseFloat(this.state.realPayMoney || 0) -
                                        (this.state.selectCode == 'CASH' ? (this.state.cashPayMoney ? this.state.cashPayMoney : hospMoney) :
                                            (this.state.otherPayCode == 'CASH' ? this.state.otherPayMoney : 0))) > 0 ?
                                        (parseFloat(this.state.realPayMoney || 0) -
                                            (this.state.selectCode == 'CASH' ? (this.state.cashPayMoney ? this.state.cashPayMoney : hospMoney) :
                                                (this.state.otherPayCode == 'CASH' ? this.state.otherPayMoney : 0))) : 0} />
                            </span><br />
                        </div> : null}

                        {/**切换支付方式 */}
                        <div style={{ marginTop: 10, marginLeft: 27, display: 'inline-block' }}>
                            <div>切换模式<RadioGroup style={{ marginLeft: 5 }} value={this.state.radioValue} onChange={this.changeRadio.bind(this)}>
                                <Radio value='1'>单一支付</Radio>
                                <Radio value='2'>组合支付</Radio>
                            </RadioGroup></div>
                        </div>
                    </div>
                </div>
            </Modal></div>
    }
}

export default Form.create()(ShowGetNumModal);